package net.lucamasini.ricette.client.ingredienti.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

public class RefreshListaIngredientiEvent extends GwtEvent<RefreshListaIngredientiEvent.Handler> {

	public static interface Handler extends EventHandler {
		void onRefreshListaIngredientiRequest(RefreshListaIngredientiEvent event);
	}

	public final static Type<Handler> TYPE = new Type<RefreshListaIngredientiEvent.Handler>();

	private final boolean clearCache;
	
	public RefreshListaIngredientiEvent(boolean clearCache) {
		this.clearCache = clearCache;
	}

	@Override
	public Type<Handler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.onRefreshListaIngredientiRequest(this);
	}

	public boolean isClearCache() {
		return clearCache;
	}
}
